package com.cuit.mimall.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cuit.mimall.common.R;
import com.cuit.mimall.entity.Order;
import com.cuit.mimall.entity.OrderItem;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author TeaWu
 * @since 2023-07-02
 */
public interface IOrderService extends IService<Order> {

    R<?> addOrder(Order order, List<OrderItem> items);

    R<?> getOrders(Long userId, Integer pageNum, Integer pageSize);

    R<?> deleteOrder(Long orderId);

    R<?> payOrder(Long orderId);

    /**
     * 根据订单号和订单状态查询订单项
     *
     * @param pageNumber  页码
     * @param pageSize    每页数量
     * @param orderNo     订单号
     * @param orderStatus 订单状态
     */
    R<?> getOrderItemByCondition(Integer pageNumber, Integer pageSize, String orderNo, Integer orderStatus);

    /**
     * 添加秒杀订单
     *
     * @param seckillId 秒杀商品id
     * @param userId    用户id
     */
    void addSeckillOrder(String seckillId, String userId);
}
